// 预约api  个人预约和团体预约
import request from '@/utils/request';

const baseUrl = "/api/front/hitch/passengerManager";


export const ordersApi = {

	/**
	 * 个人预约
	 */
	add(data) {
		return request.post("/api/front/hitch/passengerManager/addOrder", data);
	},

	//根据订单状态查询 所对应的订单
	getOrdersByType(id) {
		return request.get(`/api/front/hitch/passengerManager/byType?id=${id}`);
	},
	/**
	 * 团体预约
	 */
	adds(data) {
		return request.post("/api/front/hitch/passengerManager/addOrders", data);
	},
	/**
	 * 修改订单
	 */
	edit(id) {
		return request.get(`/api/front/hitch/passengerManager/edit?id=${id}`);
	},
	/**
	 * 获取可预约天数和参观时间
	 */
	getTime() {
		return request.get("/api/front/hitch/passengerManager/getTime");
	},
	/**
	 * 根据订单id 查询订单详情信息
	 */
	getXiangQing(data) {
		return request.get("/api/front/hitch/passengerManager/ByIdList", data);
	},
	/**
	 * 根据订单id 查询二维码
	 */
	getCode(id) {
		return request.get(`/api/front/hitch/passengerManager/getCode?orderId=${id}`);
	},
	/**
	 * 根据注册人员表id修改实名认证
	 */
	updateIsRealName(id, faceId) {
		return request.get(`/api/front/hitch/passengerManager/updateIsRealName?personId=${id}&faceId=${faceId}`);
	},
	/**
	 * 向后端任务表中添加数据
	 */
	createByUrl(id, imgUrl, faceId) {
		return request.get(
			`/api/front/hitch/passengerManager/createByUrl?personId=${id}&imgUrl=${imgUrl}&faceId=${faceId}`);
	},
	updateImageByOrderDetailId(orderDetailId, imgUrl) {
		return request.get(
			`/api/front/hitch/passengerManager/updateImageByOrderDetailId?orderDetailId=${orderDetailId}&imgUrl=${imgUrl}`
		);
	},
	/**
	 * 根据身份证号和手机号和订单状态查询是否有订单 有订单之后不能再进行预约
	 */
	getOrderCountByPhoneAndIdCardAndOrderStatus(phone, idCard) {
		return request.get(
			`/api/front/hitch/passengerManager/getOrderCountByPhoneAndIdCardAndOrderStatus?phone=${phone}&idCard=${idCard}`
		);
	},
	updateImageByOrderId(orderId, imgUrl) {
		return request.get(
			`/api/front/hitch/passengerManager/updateImageByOrderId?orderId=${orderId}&imgUrl=${imgUrl}`
		);
	}

};